//
//  brandCell.m
//  ILiangCang
//
//  Created by ZX on 16-4-17.
//  Copyright (c) 2016年 CRQ. All rights reserved.
//

#import "brandCell.h"
#import "Masonry.h"

@implementation brandCell

- (void)awakeFromNib {
    // Initialization code
}
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self)
    {
        
        
//        self.backgroundColor = [UIColor blackColor];
        
        UIImageView * bg = [[UIImageView alloc]init];
        bg.image = [UIImage imageNamed:@"bannerPlaceHolder"];
        [self.contentView addSubview:bg];
        [bg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.bottom.right.mas_equalTo(self.contentView).with.offset(0);
        }];
        

        _image = [[UIImageView alloc]init];
        _image.backgroundColor = [UIColor clearColor];
        [self.contentView addSubview:_image];
        
        
        _title = [[UILabel alloc]init];
        _title.backgroundColor = [UIColor clearColor];
//        _title.text = @"wakakakkakakakak";
        _title.textColor = [UIColor lightGrayColor];
        _title.font = [UIFont systemFontOfSize:13];
        [self addSubview:_title];
        [_image mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView.mas_top).with.offset(5);
            make.left.equalTo(self.contentView.mas_left).with.offset(10);
            make.bottom.equalTo(self.contentView.mas_bottom).with.offset (-5);
            make.width.mas_equalTo(50);
            make.height.mas_equalTo(50);
            
        }];
        [_title mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(_image.mas_right).with.offset(10);
            make.right.equalTo(self.contentView.mas_right).with.offset(-30);
            make.centerY.equalTo(self.contentView.mas_centerY);
            make.height.mas_equalTo(25);
        }];
        
        _icon = [[UIImageView alloc]init];
        _icon.backgroundColor = [UIColor clearColor];
        _icon.image = [UIImage imageNamed:@"icn_brand"];
        [self.contentView addSubview:_icon];
        [_icon mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(self.contentView.mas_centerY);
            make.right.equalTo(self.contentView.mas_right).with.offset(-15);

        }];
        
}
    
    return self;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
